﻿#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_SymbolInfoView.h"
#include <QDropEvent>
#include "MarketDataBase.h"

class SymbolInfoView : public QMainWindow
{
    Q_OBJECT

public:
    SymbolInfoView(const QString &pFile, QWidget *parent = Q_NULLPTR);

private slots:
	void readFile();
protected:
	virtual void dragEnterEvent(QDragEnterEvent *e);
	virtual void dropEvent(QDropEvent *event);
private:
	// 展示合约信息
	void readSymbol(const QString &filePath);
	// 展示行情信息
	void readMarketData(const QString &filePath);
	// 展示K线信息
	void readKItems(const QString &filePath);
	// 行情帧信息 价格
	void readFramePrice(const QString &filePath);
	//// 行情帧信息 K线
	//void readFrameKItems(const QString &filePath);

	// 创建tabItem
	QTableWidgetItem *createTabItem(float pVal);
	QTableWidgetItem *createTabItem(unsigned int pVal);
	QTableWidgetItem *createIndexTabItem(long long pVal);
	QTableWidgetItem *createTabItem(int pVal);
	QTableWidgetItem *createTimeTabItem(time_t ptmVal);
	QTableWidgetItem *createTabItem(char ptmVal[]);
	QTableWidgetItem *createTabItem(char ProductClass);

    Ui::SymbolInfoViewClass ui;
	QString m_curFileName;
};
